Fix application status error on stake details page #672
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a bug that caused inaccuracies in the statuses of the tbtc and random beacon apps on the stake detail page. When you refresh the details page for a stake that the apps were not authorized for, it incorrectly displays them as authorized:
![image](https://private-user-images.githubusercontent.com/40306834/286991065-321373fb-093b-42ff-9b41-a8efcada6948.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTk1OTAsIm5iZiI6MTczOTI5OTI5MCwicGF0aCI6Ii80MDMwNjgzNC8yODY5OTEwNjUtMzIxMzczZmItMDkzYi00MmZmLTliNDEtYThlZmNhZGE2OTQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE4NDEzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgwYWM3MThkZGI3YzkwMjcyMjU4NGY4MTYzZWM3ZGNmZDc4ODVhZmYzOGQxOWRmMDQ1ZWJjZjVjNmYwYWUwYTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.AFr3LDnRGKx0niwn_FpjQQTLfpHbIu-zZ2NgNa97BOg)
This issue resolves itself when you navigate to the authorization or staking page and then return to the details page:
![image](https://private-user-images.githubusercontent.com/40306834/286991185-a3486697-47cc-48cd-93ce-8307d53e856f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTk1OTAsIm5iZiI6MTczOTI5OTI5MCwicGF0aCI6Ii80MDMwNjgzNC8yODY5OTExODUtYTM0ODY2OTctNDdjYy00OGNkLTkzY2UtODMwN2Q1M2U4NTZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE4NDEzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyMmMyZGY4YmFmNTNlYWUxZDIxZGM1NGM4OTQxYjYxY2Q4Y2UyZDZmM2UxZWE3ZTc3MWFmYmQzZDE4NWNkZDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.cyQSGCw94jCMxHxWv9AvCh5SUMdPGfabPGfQ9F_a--I)
The issue arises from the fact that we did not dispatch the
getSupportedApps
action on the detail page. Consequently, thegetSupportedAppsEffect
was not triggered, leading to theminimumAuthorization
value being set to 0 in theselectStakingAppByStakingProvider
selector. This results in theisAuthorized
flag being set to true:token-dashboard/src/store/staking-applications/selectors.ts
Lines 38 to 42 in 4f9b5cb